<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Create New User</title>
        <h:outputStylesheet name="css/jsfcrud.css"/>
    </h:head>
    <h:body>
        <f:view>
            <h:panelGrid columns="1" border="0">
                <h:form id="create">
                    <h:panelGrid columns="3" border="0">
                        <f:facet name="header">
                            <h:outputText value="Create Account"/>
                        </f:facet>
                        First Name: <h:inputText id="fname"
                                                 requiredMessage="*"
                                                 value="#{User.name}"
                                                 required="true"/>
                        <h:message for="create:fname" style="color: red"/>
                        Last Name: <h:inputText id="lname"
                                                requiredMessage="*"
                                                value="#{User.surname}"
                                                required="true"/>
                        <h:message for="create:lname" style="color: red"/>
                        Username: <h:inputText id="username"
                                               requiredMessage="*"
                                               value="#{User.username}"
                                               required="true"/>
                        <h:message for="create:username" style="color: red"/>
                        Password: <h:inputSecret id="password"
                                                 requiredMessage="*"
                                                 value="#{User.password}"
                                                 required="true"/>
                        <h:message for="create:password" style="color: red"/>
                        Password (verify): <h:inputSecret id="passwordv"
                                                          requiredMessage="*"
                                                          value="#{User.passwordv}"
                                                          required="true"/>
                        <h:message for="create:passwordv" style="color: red"/>
                        Registration Type: <h:selectOneMenu id="type"
                                                            requiredMessage="*"
                                                            value="#{User.type}"
                                                            required="true">
                            <f:selectItems value="#{User.userTypes}"/>

                        </h:selectOneMenu>
                        <h:message for="create:type" style="color: red"/>
                    </h:panelGrid>
                    <h:commandButton id="submit"
                                     value="Create"
                                     action="#{User.createUser}"/>
                    <h:messages style="color: red" globalOnly="true"/>
                </h:form>
            </h:panelGrid>
        </f:view>
    </h:body>
</html>

